﻿<UserControl x:Class="DigitalCv.Desktop.Views.TechnologyView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:Caliburn="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="200" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
      
        <Grid Grid.Column="0" IsEnabled="{Binding IsEditing, Converter={StaticResource InverseBooleanConverter}}">
          <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
          </Grid.RowDefinitions>

          <ListBox Grid.Row="0" x:Name="Technologies">
            <ListBox.ItemTemplate>
              <DataTemplate>
                <Grid>
                  <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                  </Grid.RowDefinitions>
                  <TextBlock Grid.Row="0" Text="{Binding Name}" />
                  <Grid Grid.Row="1">
                    <Grid.ColumnDefinitions>
                      <ColumnDefinition Width="*" />
                      <ColumnDefinition Width="Auto" />
                      <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <Button Grid.Column="1" Caliburn:Message.Attach="Edit($dataContext)">Edit</Button>
                    <Button Grid.Column="2" Caliburn:Message.Attach="Delete($dataContext)">Delete</Button>
                  </Grid>
                </Grid>
              </DataTemplate>
            </ListBox.ItemTemplate>
          </ListBox>

          <Button Grid.Row="1" x:Name="Add">Add</Button>
          
        </Grid>              
    </Grid>
</UserControl>
